import request from "@/utiles/request";
// 获取学生列表
export const getStudentListAPI = (
  pageNo = 1,
  pageSize = 10,
  stuName = "",
  className = ""
) =>
  request.get(
    `/student/list?pageNo=${pageNo}&pageSize=${pageSize}&stuName=${stuName}&className=${className}`
  );
//修改或者添加学生
export const AddOrUpdateStudentAPI = (data)=>{
    if(data._id) {
        return request.put(`/student/update?stuId=${data._id}`,data)
    }else {
        return request.post('/student/add',data)
    }
}
//获取学生详情
export const getStudentDetailAPI = (stuId)=>request.get(`/student/detail?stuId=${stuId}`)
//批量添加学生
export const batchAddStudentAPI = (data)=>request.post('/student/add/batch',data)
//删除学生
export const deleteStudentAPI = (stuId)=>request.delete(`/student/delete?stuId=${stuId}`)